<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <div id="app">
       <div>
          <label for="">商品价格</label>
          <input type="number" v-model="price">
       </div>

       <div>
          <label for="">商品数量</label>
          <button v-on:click="count=count-1<0? 0:count-1">-</button><span>{{count}}</span>
          <button v-on:click="count++">+</button>
       </div>

       <div>
          总价格:<strong>{{price*count}}</strong>
       </div>
    </div>
    <script src="vue.js"></script>
    <script>
       new Vue({
          el:'#app',
          data:{
            price:5,
            count:2
          }
       })
    </script>
  </body>
</html>
